require 'rubygems'
require 'capistrano'
require 'action_mailer' unless defined?(ActionMailer)
require 'config/cap_mailer_settings'

module CapistranoMailer
  def send(rails_env, repository, command, deploy_to, host = nil, ip_address = nil, output = nil)
    CapMailer.deliver_notification_email(rails_env, repository, command, deploy_to, host, ip_address, output)
  end
end

Capistrano.plugin :mailer, CapistranoMailer
